﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MemberLevel.aspx.cs" Inherits="bianzhuo.SupportPlatform.BzBusiness.MemberLevel" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>会员等级</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/msg_css.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="js/common.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
        <div class="content">
            <ul class="breadcrumb">
                <li><a href="#">首页</a> <span class="divider">/</span></li>
                <li class="active">会员等级</li>
            </ul>
            <div class="container">
                <div class="member_div">
                    <ul>
                        <li>
                            <div class="mem_dbg mem_dbg01 mem_dtmd"></div>
                            <div class="mem_dtit"><a class="mem_dta" href="UserCardModify.aspx?MicroId=<%=Request["MicroId"]%>">会员卡设置</a></div>
                        </li>
                        <li>
                            <div class="mem_dbg mem_dbg02 mem_dtmd"></div>
                            <div class="mem_dtit"><a class="mem_dta" href="MemberClassDefault.aspx?MicroId=<%=Request["MicroId"]%>">会员卡等级</a></div>
                        </li>
                        <li>
                            <div class="mem_dbg mem_dbg03  mem_dtmd"></div>
                            <div class="mem_dtit"><a class="mem_dta" href="MemberPackageDefault.aspx?MicroId=<%=Request["MicroId"]%>">会员卡套餐</a></div>
                        </li>
                        <li>
                            <div class="mem_dbg mem_dbg04  mem_dtmd"></div>
                            <div class="mem_dtit"><a class="mem_dta" href="MemberPromotionDefault.aspx?MicroId=<%=Request["MicroId"]%>">会员促销活动</a></div>
                        </li>
                        <li>
                            <div class="mem_dbg mem_dbg05"></div>
                            <div class="mem_dtit"><a class="mem_dth" href="UserInfoDefault.Aspx?MicroId=<%=Request["MicroId"]%>">会员管理</a></div>
                        </li>
                    </ul>
                </div>
                <div class="user_msg">
                    <div class="user_msg_l2">

                        <div class="mem_tcdiv">
                            <ul id="memberlevel">
                            </ul>
                        </div>
                        <div class="hftc_mainbut">
                            <button type="button" class="btn btn-01 btnok">确定操作</button>&nbsp;&nbsp;
                            <button type="button" class="btn" onclick="history.go(-1)">取消返回</button>
                        </div>
                    </div>
                    <div class="user_msg_r">
                        <div class="user_mrtop">会员详细资料</div>
                        <div class="user_listdet">
                            <ul>
                                <li class="user_libg_01"><a href='UserInfoView.Aspx?UserId=<%=Request["UserId"].ToString() %>&MicroId=<%=Request["MicroId"].ToString() %>' class="user_list_a">基本资料</a></li>
                                <li class="user_libg_02"><a href="MemberRecharge.aspx?UserId=<%=Request["UserId"].ToString() %>&MicroId=<%=Request["MicroId"].ToString() %>" class="user_list_a">会员帐户<font>(<%=Convert.ToDouble(ViewUser.CardBalance).ToString("C") %>)</font></a></li>
                                <li class="user_libg_03"><a href="MemberPoint.aspx?UserId=<%=Request["UserId"].ToString() %>&MicroId=<%=Request["MicroId"].ToString() %>" class="user_list_a">积分管理<font>(<%=ViewUser.CardPoints %>分)</font></a></li>
                                <li class="user_libg_06"><a href="MemberLevel.aspx?UserId=<%=Request["UserId"].ToString() %>&MicroId=<%=Request["MicroId"].ToString() %>" class="user_list_h">会员等级<font>(<%=CardLevel.LevelName %>)</font></a></li>
                                <li class="user_libg_07"><a href="MemberPackage.aspx?UserId=<%=Request["UserId"].ToString() %>&MicroId=<%=Request["MicroId"].ToString() %>" class="user_list_a">会员套餐<font>(<%=CardPackage !=null?CardPackage.PkgName:"" %>)</font></a></li>
                                <li class="user_libg_04"><a href="MemberPower.aspx?UserId=<%=Request["UserId"].ToString() %>&MicroId=<%=Request["MicroId"].ToString() %>" class="user_list_a">会员特权</a></li>
                                <li class="user_libg_05"><a href='UserOrderLog.Aspx?UserId=<%=Request["UserId"].ToString() %>&MicroId=<%=Request["MicroId"].ToString() %>' class="user_list_a">订单记录<font>(<%=OrderCount %>单)</font></a></li>
                            </ul>
                        </div>

                    </div>
                </div>
            </div>

        </div>

    </form>

    <script>
        $.get('UserInfoDefault.aspx?getmembercardinfo=' + getName('UserId') + '&MicroId=' + getName('MicroId') + '&t=' + Math.random(), function (data) {
            if (data != "0") {
                d = eval(data);
                d = d[0];
                $('#memberlevel').html(unescape(d.memberlevel));
                //$('#memberpackage').html(unescape(d.memberpackage));
                //$('#memberpower').html(unescape(d.memberpower));
            }

        })


        //展开套餐
        $(".mem_tcdiv li").live('click', function (e) {
            if (!($(e.target).is('input'))) {
                $(this).next(".mem_tccont").slideToggle("slow");
                if ($(this).children("div:last").attr("class") == "mem_jtx") {
                    $(this).children("div:last").removeClass("mem_jtx").addClass("mem_jts");
                } else {
                    $(this).children("div:last").removeClass("mem_jts").addClass("mem_jtx");
                }
                $('#memberpackage li[uid]').show();
                $('#memberpackage li[uid=""]').hide();


            }
        });
        $('.btnok').click(function () {
            if ($('[name=lv]:checked').length == 0) {
                alert('请先选中等级');
                return;
            }
            $.post('UserInfoDefault.aspx?changememberlevel=' + getName('UserId') + '&level=' + $('[name=lv]:checked').val() + '&MicroId=' + getName('MicroId') + '&t=' + Math.random()
               , function (data) {
                   if (data > 0) {
                       alert('变更会员等级操作成功!');
                       $('#memberlevel .memtcdq span').remove();
                       $('#memberlevel .memtcdq').removeClass('memtcdq');
                       $('[name=lv]:checked').parent().addClass('memtcdq').append('<span>已拥有</span>');
                       location.reload();
                   } else {
                       alert('变更会员等级操作失败!');
                   }
               });


        })
    </script>
</body>
</html>
